# Dockerfile for rtds-fetchservice
# 1. Copy rtds-fetchservice-${VERSION}-ghbank-dev.zip to current directory
# 2. Build with: docker build -t rtds-fetchservice .
# 3. Run with: docker run -p 8080:8080 -d -v /tmp/logs:/opt/logs --name rtds-fetchservice rtds-fetchservice

FROM java:8-jre
MAINTAINER liuxudong <liuxudong365@qq.com>

ENV VERSION 0.0.1-SNAPSHOT

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone

ADD rtds-fetchservice-${VERSION}-ghbank-dev.zip /rtds-fetchservice/rtds-fetchservice-${VERSION}-ghbank-dev.zip

RUN unzip /rtds-fetchservice/rtds-fetchservice-${VERSION}-ghbank-dev.zip -d /rtds-fetchservice \
    && rm -rf /rtds-fetchservice/rtds-fetchservice-${VERSION}-ghbank-dev.zip \
    && sed -i '$d' /rtds-fetchservice/scripts/startup.sh \
    && echo "tail -f /dev/null" >> /rtds-fetchservice/scripts/startup.sh

EXPOSE 8080

CMD ["/rtds-fetchservice/scripts/startup.sh"]
